Make multiple libraries warning more consistent #151
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Originally, this warning was always printed when multiple libraries were
found for a header filename. #37 reported that this can be confusing for
novice users, when for example a platform library overrides a builtin
library, which is typically considered "normal" and should not generate
a warning.
The previous attempt at fixing #37 (which is reverted by this PR) would hide the
warning in these "normal" cases, but it ended up also hiding the message
in cases where it would be relevant (as reported on the mailing
list). Also, if for a single compilation some of these messages are
hidden, but others are not, this might cause users to draw incorrect
conclusions if they are not aware of the exceptions ("there must be only
one library for this header file, since I didn't see any message").
This commit takes a different approach: these messages are only shown when:
warning, shown in red in the IDE.
as informational, shown in white in the IDE.
This means that these message are either all shown, or none of them
are shown, which should make the behaviour more predictable. There is
still a chance that the "normal" messages described in #37 confuse a
novice user when there is a compilation error completely unrelated to
the chosen libraries, but it is pretty impossible for arduino-builder to
know the cause of a failed compilation, so just showing all of these
messages on an error seems the best approach.